package com.itcast.mallweb.mapper;

import com.itcast.admin.entity.Seckill;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SeckillMapper {
    //新增秒杀模块
    @Insert("insert into seckill(name, price, number, create_time, end_time, status, avatar) " +
            "values (#{name},#{price},#{number},#{createTime},#{endTime},#{status},#{avatar})")
    void addSeckill(Seckill seckill);

    //查询全部秒杀商品
    @Select("select * from seckill")
    List<Seckill> qureySeckillAll();

    //查询单个秒杀商品
    @Select("select * from seckill where id = #{id}")
    Seckill seckillQuery(Integer id);

    //批量删除秒杀商品
    void seckillDetele(List<Long> ids);

    //修改秒杀商品
    void seckillAmend(Seckill seckill);
}
